define(function(require, exports, module) {
  'use strict';

  var Search = require('../../common/search/search');

  var opts = [
    '<a href="javascript:;" data-role="audit">审核</a>',
    '<a href="javascript:;" data-role="del">删除</a>'
  ];
  new Search({
    url: 'kmInfoList',
    keepHistory: false,
    dateCfg: {
      disabled: true
    },
    formCfg: {
      data: {
        groups: [{
          // label: '页面名称',
          colspan: null,
          attrs: {
            type: 'text',
            name: 'docSubject',
            maxlength: 30,
            placeholder: '标题'
          }
        }, {
          colspan: null,
          value: '<i class="fa fa-search"></i> 搜索',
          attrs: {
            type: 'submit'
          }
        }]
      }
    },
    gridCfg: {
      columns:[
        {key:'id', name: '序号'},
        {key:'docSubject', name: '标题'},
        {key:'cateSubject', name: '标签'},
        {key:'docCreateTime', name: '创建时间'},
        {name: '操作', template: opts.join('')}
      ]
    },
    delegates: {
      'click [data-role=audit]': function() {
        window.location.href = window.GLOBAL.CTX + '/admin/knowledge/info/add.html';
      }
    }
  });
});
